Some recent data processing systems have a host computer and a printer connected to the host computer through a bi-directional interface (e.g., IEEE1284.4, IEEE1394, or USB). A data processing system using such a printer analyzes output information received from the host computer, bitmaps the information to output data of, e.g., a laser beam printer using a printer engine, and scans and exposes a photosensitive drum with a laser beam modulated on the basis of the bitmap data, thereby printing the image.
A printer having an emulation function is designed to process a plurality of printer control language systems and also to execute printing while switching between the emulation mode and the normal mode in accordance with an application executed by the user. Such a printer has a switch for switching the printer control language or a card slot for switching a circuit board. Many printers can directly print image data from an image input device such as a scanner or digital camera without intervening a host computer. Additionally, along with the recent improvement of processing ability of host computers, various new image processing technologies have been employed. An example is an image processing technology called “gradient fill” for the purpose of filling a predetermined region with smooth grayscale (halftone).
The difference between a conventional drawing technique and the technique of filling a region with grayscale using gradient fill will be described as follows. FIG. 1A is a view showing the conventional technique, in which a plurality of objects with different gray levels are arranged and drawn to express the grayscale in the region. In this conventional technique, to eliminate the steps between the gray levels, a number of objects having different gray levels must be generated. This makes data redundant. If the relationship between the data transfer rate and the printing speed is inappropriate, and a number of objects cannot be generated, discontinuities are formed between gray levels.
FIG. 1B is a view showing gradient fill (a rectangular gradient fill object is used) in which the coordinates and gray levels (8-bit gray levels; 0=black and 255=white) of the rectangle are designated, and the region is filled while calculating the gray levels in units of pixels in the image region. Gradient fill objects include a rectangular gradient fill object which mainly draws predetermined gradation in the horizontal or vertical direction and a triangular gradient fill object which draws predetermined gradation in an arbitrary direction. The triangular gradient fill object can also draw predetermined gradation in the horizontal or vertical directions depending on the position and the manner the colors are given.
A rectangular gradient fill object has, as information, coordinates and gray levels of two points and the gradation direction (horizontal or vertical). The gray level of each pixel of a rectangular gradient fill object can be obtained as follows. As shown on the right side of FIG. 1B, the apex positions are applied to (x, y) coordinates. Letting (x1, y1, c1) be the coordinated and gray level of apex 1, (x2, y2, c2) be the coordinates and gray level of apex 2, and (xn yn, cn) be the coordinates and gray level of an arbitrary target pixel, predetermine gradation in the horizontal direction is given bycn=(c2−c1)/(x2−x1)x xn and predetermined gradation in the vertical direction given bycn=(c2−c1)/(y2−y1)x yn 
FIG. 1C is a view showing a triangular gradient fill object. A triangular gradient fill object has, for information, the coordinates and gray levels of three apexes. When gray levels are designated at three apexes of a triangle, the gradation direction can have a degree of freedom.
The gray level of an arbitrary pixel of the triangular gradient fill object can be obtained by applying gray levels to the three apexes, as in the rectangular gradient fill object, and solving the following simultaneous equations.x1×i+y1×j+k=c1 x2×i+y2×j+k=c2 x3×i+y3×j+k=c3 The gradation cn is given bycn=i×xn+j×yn+k                 where i, j, and k are coefficients.        
A considerable time is required to draw a gradient fill object because the gray levels are obtained in units of pixels using the above equations. However, printing apparatuses have various grayscale expression abilities. If the gray level of each pixel cannot be accurately expressed, halftone expression using a plurality of pixels by dithering or the like is used. In this case, although image data is generated by performing calculation in units of pixels, the grayscale expression of each pixel is not reflected to the printed image, and processing is only time-consuming.
Additionally, in generating a gradient fill object, when gradation having a predetermined pattern in the horizontal or vertical direction should be generated, calculation for each pixel can be omitted by repeatedly using the pattern generated once. In the prior art, however, since calculation is performed for each of all pixels, the processing speed is low.